package com.glela.biz;


import java.io.IOException;

import com.glela.domain.dto.BackRedPacketRequest;
import com.glela.domain.dto.ConsumeRedPacketRequest;
import com.glela.domain.dto.GetRedPacketByShareKeyRequest;
import com.glela.domain.dto.GiveRedPacketByEventRequest;
import com.glela.domain.dto.GiveRedPacketByTemplateRequest;
import com.glela.domain.dto.ReceiveRedPacketRequest;
import com.glela.domain.dto.ShareRedPacketRequest;
import com.glela.domain.dto.SystemGiveRedPacketRequest;
import com.glela.domain.vo.GetRedPacketByShareKeyVo;
import com.glela.domain.vo.PerRedPacketResponseVo;
import com.glela.domain.vo.ShareRedPacketVo;
import com.glela.packet.exception.RedPacketBizException;

public interface RedPacketBiz {
  /***
   * 系统赠送
   * @param request
   * @return
   */
  boolean systemGiveRedPacket(SystemGiveRedPacketRequest request) throws RedPacketBizException;

  /****
   * 分享红包
   * @param request
   * @return
   */
  ShareRedPacketVo shareRedPacket(ShareRedPacketRequest request) throws RedPacketBizException;

  /****
   * 领取红包
   * @param request
   * @return
   */
  GetRedPacketByShareKeyVo receiveRedPacket(ReceiveRedPacketRequest request) throws RedPacketBizException;

  /***
   * 消费红包
   * @param request
   * @return
   */
  boolean consumeRedPacket(ConsumeRedPacketRequest request) throws RedPacketBizException;

  /****
   * 退回红包
   * @param request
   * @return
   */
  boolean backRedPacket(BackRedPacketRequest request) throws RedPacketBizException;

  /*****
   * 红包失效
   * @param userId
   */
  void redPacketInvalid(int userId);

  /****
   * 通过事件类型给用户发红包
   *
   * @param request
   * @return
   */
  boolean giveRedPacketByEventType(GiveRedPacketByEventRequest request) throws RedPacketBizException;

  /***
   * 根据shareKey获取红包信息
   * @param request
   * @return
   */
  GetRedPacketByShareKeyVo getRedPacketByShareKey(GetRedPacketByShareKeyRequest request);
  
  /****
   * 获取个人红包列表
 * @param clientType 
   * @param request
   * @return
   */
	PerRedPacketResponseVo showRedPacketList(Long userId, int type, int startIndex, Integer pageSize, String clientType) throws IOException;


  /*****
   * 根据红包板块发送红包
   * @param request
   * @return
   * @throws RedPacketBizException
   */
  boolean giveRedPacketByTemplate(GiveRedPacketByTemplateRequest request) throws RedPacketBizException;
  
}
